/*
 *    This file is part of SSHTunneler.
 *
 *    Copyright 2009 Jean-Sebastien Gelinas <calestar@gmail.com>
 *
 *    SSHTunneler is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    SSHTunneler is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with SSHTunneler.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
package sshtunneler.packager.gui.frames;

import java.util.ArrayList;
import java.util.List;

public class MyInternalFrameActionDispatcherFrame extends javax.swing.JFrame {
	private static final long serialVersionUID = 7280710339583057976L;
	List<MyActionListener> listeners_path_tools_changed = new ArrayList<MyActionListener>();
	List<MyActionListener> listeners_path_tunneler_changed = new ArrayList<MyActionListener>();
	List<MyActionListener> listeners_path_installer_changed = new ArrayList<MyActionListener>();
	List<MyActionListener> listeners_config_changed = new ArrayList<MyActionListener>();
	List<MyActionListener> listeners_script_variable_changed = new ArrayList<MyActionListener>();
	List<MyActionListener> listeners_additional_files_changed = new ArrayList<MyActionListener>();

	public void add_path_tools_listener(MyActionListener f) {
		if (!this.listeners_path_tools_changed.contains(f)) {
			this.listeners_path_tools_changed.add(f);
		}
	}

	public void fire_path_tools_changed() {
		for (MyActionListener f : this.listeners_path_tools_changed) {
			f.refresh();
		}
	}

	public void add_path_tunneler_listener(MyActionListener f) {
		if (!this.listeners_path_tunneler_changed.contains(f)) {
			this.listeners_path_tunneler_changed.add(f);
		}
	}

	public void fire_path_tunneler_changed() {
		for (MyActionListener f : this.listeners_path_tunneler_changed) {
			f.refresh();
		}
	}

	public void add_path_installer_listener(MyActionListener f) {
		if (!this.listeners_path_installer_changed.contains(f)) {
			this.listeners_path_installer_changed.add(f);
		}
	}

	public void fire_path_installer_changed() {
		for (MyActionListener f : this.listeners_path_installer_changed) {
			f.refresh();
		}
	}

	public void add_config_listener(MyActionListener f) {
		if (!this.listeners_config_changed.contains(f)) {
			this.listeners_config_changed.add(f);
		}
	}

	public void fire_config_changed() {
		for (MyActionListener f : this.listeners_config_changed) {
			f.refresh();
		}
	}

	public void add_script_variable_listener(MyActionListener f) {
		if (!this.listeners_script_variable_changed.contains(f)) {
			this.listeners_script_variable_changed.add(f);
		}
	}

	public void fire_script_variable_changed() {
		for (MyActionListener f : this.listeners_script_variable_changed) {
			f.refresh();
		}
	}

	public void add_additional_files_listener(MyActionListener f) {
		if (!this.listeners_additional_files_changed.contains(f)) {
			this.listeners_additional_files_changed.add(f);
		}
	}

	public void fire_additional_files_changed() {
		for (MyActionListener f : this.listeners_additional_files_changed) {
			f.refresh();
		}
	}

}
